package org.vestbjergbyggecenter.Model;

public class Employee extends Person{
	private String username;
	private String password;
	private int salary;
	
	//Constructor
	public Employee(int employeeId, String employeeName, long employeeCPR, String employeeAddress, long employeePostalCode, String employeeCity, String employeePhone, String employeeUsername, String employeePassword, int employeeSalary)
	{
		super(employeeId, employeeName, employeeCPR, employeeAddress, employeePostalCode, employeeCity, employeePhone);
		this.username=employeeUsername;
		this.password=employeePassword;
		this.salary=employeeSalary;
	}
	
	/*
	 * Method sets the id of an employee.
	 */
	public void setEmployeeID(int newEmployeeID)
	{
		super.setId(newEmployeeID);
	}
	
	/*
	 * Method returns the ID of an employee.
	 */
	public int getEmployeeID()
	{
		return super.getId();
	}
	
	/*
	 * Method sets the username of an employee.
	 */
	public void setUsername(String newUsername)
	{
		this.username=newUsername;
	}
	
	/*
	 * Method returns the username of an employee.
	 */
	public String getUsername()
	{
		return username;
	}
	
	/*
	 * Method sets the password for an employee.
	 */
	public void setPassword(String newPassword)
	{
		this.password=newPassword;
	}
	
	/*
	 * Method returns the password of an employee.
	 */
	public String getPassword()
	{
		return password;
	}
	
	/*
	 * Method sets the salary of an employee.
	 */
	public void setSalary(int newSalary)
	{
		this.salary=newSalary;
	}
	
	/*
	 * Method returns the salary of an employee.
	 */
	public int getSalary()
	{
		return salary;
	}
	
	/*
	 * Method checks if an employee is a manager.
	 * Employee is registered in the employee Array List.
	 */
	public boolean isManager()
	{		
			if(this instanceof Manager)
			{
				return true;
			}
			else
			{
				return false;
			}		
	}

	public boolean isSalesAssistant()
	{
		if(this instanceof SalesAssistant)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	public void print()
	{
		System.out.println();
		System.out.println("Username: " + username + "Password: " + password + "Salary: " + salary);		
	}
	
}
